-- GENERATED SPELL FOR [Doomguard Commander] --


function spell0_12396(pUnit, Event) --@Cripple,n/a--
pUnit:FullCastSpellOnTarget(20812,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12396', 15294, 1)
end

function spell1_12396(pUnit, Event) --@Crystal Imprisonment,Self--
pUnit:FullCastSpellOnTarget(23020,pUnit)
pUnit:RegisterEvent('Sorts_12396', 584, 1)
end

function spell2_12396(pUnit, Event) --@Dispel Magic,n/a--
pUnit:FullCastSpellOnTarget(15090,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12396', 602, 1)
end

function spell3_12396(pUnit, Event) --@Rain of Fire,n/a--
pUnit:FullCastSpellOnTarget(16005,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12396', 9000, 1)
end

function spell4_12396(pUnit, Event) --@War Stomp,Self--
pUnit:FullCastSpellOnTarget(16727,pUnit)
pUnit:RegisterEvent('Sorts_12396', 5311, 1)
end

function Sorts_12396(pUnit, Event)
local choix_sorts_12396 = math.random(0, 4)
if choix_sorts_12396 == 0 then
pUnit:RegisterEvent('spell0_12396', 1, 1)
end
if choix_sorts_12396 == 1 then
pUnit:RegisterEvent('spell1_12396', 1, 1)
end
if choix_sorts_12396 == 2 then
pUnit:RegisterEvent('spell2_12396', 1, 1)
end
if choix_sorts_12396 == 3 then
pUnit:RegisterEvent('spell3_12396', 1, 1)
end
if choix_sorts_12396 == 4 then
pUnit:RegisterEvent('spell4_12396', 1, 1)
end
end

function mob12396_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_12396', math.random(1500, 3000), 1)
end

function mob12396_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12396_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12396_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(12396, 1, 'mob12396_Action')
RegisterUnitEvent(12396, 2, 'mob12396_Leave')
RegisterUnitEvent(12396, 3, 'mob12396_Kill')
RegisterUnitEvent(12396, 4, 'mob12396_Die')
